#pragma once
#include <string>
#include "..\utils\GameMath.h"
#include "NodeTransformation.h"
#include "..\content\ResManager.h"

namespace ds {

class Node : public NodeTransformation {

public:
	Node(const std::string& name) : m_Name(name) , m_Orthogonal(false) {
		LOGC(logINFO,"Node") << "creating new node - orthogonal false" << m_Name;
	}
	Node(const std::string& name,bool orthogonal = false) : m_Name(name) , m_Orthogonal(orthogonal) {
		LOGC(logINFO,"Node") << "creating new node " << m_Name << " - orthogonal " << orthogonal;
	}
	Node(const std::string& name,const std::string& materialName,bool orthogonal = false);
	virtual ~Node() {};	
	std::string& getName() { 
		return m_Name; 
	}	
	bool isActive() const { 
		return m_Active;
	}
	void setActive(bool active) { 
		m_Active = active; 
	}
	bool isOrthogonal() const { 
		return m_Orthogonal; 
	}
	virtual void onCreateDevice() {}
	virtual void onResetDevice() {}
	virtual void onLostDevice() {}
	virtual void onDestroyDevice() {}
	ResourceHandle getMaterialHandle() const { 
		return m_MaterialHandle; 
	}
	void setMaterialName(const std::string& materialName);
	// basic methods
	virtual void init() {}
	virtual void loadContent(ResManager& resourceManager) {}	
	virtual void update(float elapsed) {}
	// rendering
	virtual void prepareRendering() {}
	virtual void draw() {}
	virtual void postRendering() {}
protected:
	std::string m_Name;
	bool m_Active;
	bool m_Orthogonal;	
	ResourceHandle m_MaterialHandle;
};

}

